#!/usr/bin/python
# -*-coding: UTF-8 -*-
"""
# Time: 2024/5/10 20:24
# @Author: 修养
# @Project_name: PROJECT_NAME
"""
import math

# age = 22
# if age > 18:
#     print("成年人")
# else:
#     print("未成年人")
age = 28
if age > 18:
    print("成年人")
else:
    print("未成年人")

# names = []
# if names:   # 在if条件中, 列表名作为表达式时，列表为空时返回False,不为空时返回：True
#     print("列表不为空")
# else:
#     print("列表为空")
#
# names = ["毛泽东", "周恩来"]
# if names:
#     print(names)
stu = {}
if stu:
    print("字典不为空")
else:
    print("字典为空")

stu = {"name": "周恩来"}
if stu:
    print(stu)

# for i in range(1, 3):
#     print(i)
for i in range(1, 3):
    print(i)

# while 循环
# x = 5
# print(x)
# while x > 3:
#     print("x = ", x)
#     break

m = 1
while m < 3:
    print("x =", m)
    m = m + 1


#  continue 跳过下面的代码不执行，继续执行下一个循环
# str_s = ""
# for i in range(1, 5):
#     if i == 3:
#         continue
#     elif str_s == "":
#         str_s = str(i)
#     else:
#         str_s = str_s + "," + str(i)
# print(str_s)
str_s = ""
for i in range(1, 5):
    if i == 3:
        continue
    elif str_s == "":
        str_s = str(i)
    else:
        str_s = str_s + ',' + str(i)
print(str_s)